import { request } from '@/utils/request'
import { BASE_URL } from '@/utils/constants'
import type { LoginInfo, AuthTokens, UserInfo } from './types'

const AuthAPI = {
    login(data: LoginInfo): Promise<AuthTokens> {
        return request.post(`${BASE_URL}/auth/login`, data)
    },
    getInfo(): Promise<UserInfo> {
        return request.get(`${BASE_URL}/auth/info`)
    },
    initAdmin(): Promise<any> {
        return request.post(`${BASE_URL}/auth/init`)
    },
}

export default AuthAPI